home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 90 / CD Actual 90.iso / Software3D / K-3D / k3d-0.4.2.1 / shaders / k3d_indirect.sl < prev    next >
Encoding:
Text File  |  2004-07-23  |  818 b   |  32 lines

  1. /* indirect.sl - retrieve radiosity data from the "ray server"
  2.  * 
  3.  * This shader is never called from BMRT -- the "indirect" light source
  4.  * is built into the renderer.
  5.  *
  6.  * The RenderMan (R) Interface Procedures and RIB Protocol are:
  7.  *     Copyright 1988, 1989, Pixar.  All rights reserved.
  8.  * RenderMan (R) is a registered trademark of Pixar.
  9.  */
  10.  
  11. #include "k3d_rayserver.h"
  12.  
  13.  
  14. light k3d_indirect(output float __nonspecular = 1;)
  15. {
  16. #ifdef BMRT
  17.   /* Just in case this is ever compiled for BMRT, make it do nothing. */
  18.   Cl = 0;
  19.  
  20. #else /* PRMan - make a light that looks up from the ray server */
  21.  
  22.   /* Exploit the fact that PRMan (incorrectly) leaves the surface normal
  23.    * in N.
  24.    */
  25.   vector axis = normalize(N);
  26.   solar(-axis, 0)
  27.   {
  28.     Cl = rs_indirect(Ps, axis);
  29.   }
  30. #endif
  31. }
  32.